import com.google.common.collect.Sets;

import java.util.HashSet;

/**
 * Created by zhihao.guo on 2018/12/19.
 */
public class StudentDemo {
    public static void main(String[] args) {
        HashSet<Object> stuset = Sets.newHashSet();
        Student stu1 = new Student("123445", "你妹");
        Student stu2 = new Student("123445", "你妹");
        stuset.add(stu1);
        stuset.add(stu2);
        System.out.println("stuset.size() = " + stuset.size());

    }
    static class Student{
        String number;
        String name;

        public Student(String number, String name) {
            this.number = number;
            this.name = name;
        }

        @Override
        public int hashCode() {
            return number.hashCode();
        }
    }
}
